﻿<?php
('Access-Control-Allow-Origin：*');
include("../config/mysql.php");
$companyName = $_GET["companyName"];
$limit = $_REQUEST['limit'];
$page = $_REQUEST['page'];
$rponame = $_REQUEST["rponame"];
$typephj = $_REQUEST["typephj"];
$major = $_REQUEST["major"];
$gradation = $_REQUEST["gradation"];
$company_id = $_REQUEST["company_id"];
$sql = "SELECT e.id,e.produ,e.ject,e.price,e.Agencyprice,e.Externalprice,e.level,c.name AS cengci_name,e.xuezhi,e.remarks,e.type,ed.name AS educationtype_name,e.validYear,e.company_id FROM educational e INNER JOIN cengci c ON e.level = c.id INNER JOIN educationtype ed ON e.type = ed.id WHERE company_id = {$company_id} AND produ LIKE '%{$rponame}%' AND type LIKE '%{$typephj}%' AND ject LIKE '%{$major}%' AND LEVEL LIKE '%{$gradation}%' ORDER BY id DESC";
$Mysql = new Mysql();

$count = $Mysql->getResultNum($sql);
if ($count) {
	$start = ($page - 1) * $limit;
	$sql .= " limit {$start},{$limit}";
	/*查询表格参数一表明   参数二 查询语句*/
	$arr = $Mysql->likeSelectLayui($sql);
}

/*返回出去*/
if (is_array($arr) == 1) {
	$res = [
		'code' => 0,
		'msg' => '查询成功',
		'count' => $count,
		'data' => $arr
	];
} else {
	$res = [
		'msg' => '没有查到数据',
	];
}
echo json_encode($res, JSON_UNESCAPED_UNICODE);
/*关闭连接*/
$Mysql->close();
